package com.zixuan.common.execption;

import com.zixuan.common.Result;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExceptionHandler {



    @org.springframework.web.bind.annotation.ExceptionHandler(Exception.class)
    public Result catchException(Exception e){
        e.printStackTrace();
        return new Result(1001,false,"服务好像走丢了,等一会再来叭");
    }

    @org.springframework.web.bind.annotation.ExceptionHandler(RuntimeException.class)
    public Result catchException(RuntimeException e){
        e.printStackTrace();
        return new Result(1001,false,e.getMessage().toString());
    }

}
